﻿// Version:1
// Author:Sanket Naik
// Date:July-21-2010 
// Comments:
// 
// 
// 

using System;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Runtime.Serialization;
using ManagedServices.Common.DataTransferObject;

namespace ManagedServices.DataTransferObjects
{
    /// <summary>
    /// The Dto representing the Start Mode of a Service 
    /// </summary>
    [DataContract]
    public class StartMode : ICommonDto
    {
        /// <summary>
        /// The Start Mode representing AutoMatic
        /// </summary>
        public static readonly StartMode Automatic = new StartMode(new Guid("06B90B10-B197-499C-901E-5C2FCCB5D549"), "Automatic", 1);

        /// <summary>
        /// The Start Mode representing Automatic Delayed
        /// </summary>
        public static readonly StartMode Automatic_Delayed = new StartMode(new Guid("C2CC5055-D7D8-4578-BACC-5F9A7F310CCC"), "Automatic-Delayed", 2);

        /// <summary>
        /// The Start Mode representing Stopped
        /// </summary>
        public static readonly StartMode Stopped = new StartMode(new Guid("EA414F5F-A42D-4E00-8B5B-E5A386DFE22C"), "Stopped", 3);

        /// <summary>
        /// The Start Mode representing Manual
        /// </summary>
        public static readonly StartMode Manual = new StartMode(new Guid("934A02B1-0E5E-4AF6-80E8-C8DAF998DCF8"), "Manual", 4);

        /// <summary>
        /// The Start Mode representing Schedule
        /// </summary>
        public static readonly StartMode Schedule = new StartMode(new Guid("29767B2F-14F8-43AB-AEBC-36AD91FBE3F4"), "Schedule", 5);

        /// <summary>
        /// The Start Mode representing Schedule
        /// </summary>
        public static readonly StartMode Conditional = new StartMode(new Guid("F27604BD-ABDE-495D-953B-F2FF6E6C330C"), "Conditional", 5);
        

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="startModeID"></param>
        /// <param name="name"></param>
        /// <param name="code"></param>
        public StartMode(Guid startModeID, string name, short code)
        {
            StartModeID = startModeID;
            Name = name;
            Code = code;

            CreatedBy = Guid.Empty;
            ModifiedBy = Guid.Empty;
            CreatedOn = DateTime.Now;
            ModifiedOn = DateTime.Now;
        }

        /// <summary>
        /// The Guid representing the Start Mode Uniquely
        /// </summary>
        [DataMember]
        public Guid StartModeID { get; set; }

        /// <summary>
        /// The Name representing the Start Mode Uniquely
        /// </summary>
        [DataMember]
        public string Name { get; set; }

        /// <summary>
        /// The integer representing the Start Mode Uniquely
        /// </summary>
        [DataMember]
        public short Code { get; set; }



        /// <summary>
        /// Primary key for the DTO
        /// </summary>
        public Guid KeyId { get { return StartModeID; } set { StartModeID = value; } }

        /// <summary>
        /// Created by the User ID
        /// </summary>
        [DataMember]
        public Guid CreatedBy { get; set; }

        /// <summary>
        /// Created By User ID
        /// </summary>
        [DataMember]
        public Nullable<Guid> ModifiedBy { get; set; }

        /// <summary>
        /// Created On
        /// </summary>
        [DataMember]
        public DateTime CreatedOn { get; set; }

        /// <summary>
        /// Modified On
        /// </summary>
        [DataMember]
        public Nullable<DateTime> ModifiedOn { get; set; }
    }
}
